<html>
  <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
      <meta name="layout" content="main" />
      <title>Message List</title>
  </head>
  <body>
      <div class="nav">
          <span class="menuButton"><a class="home" href="${createLinkTo(dir:'')}">Home</a></span>
          <span class="menuButton"><g:link class="create" action="create">New Message</g:link></span>
      </div>
      <div class="body">
        <div>
          <h1>What are you doing?</h1>
          <g:hasErrors bean="${messageInstance}">
          <div class="errors">
            <g:renderErrors bean="${messageInstance}" as="list" />
          </div>
          </g:hasErrors>
          <g:form action="save" method="post" >
            <div class="dialog">
              <table>
                <tbody>
                  <tr class="prop">
                    <td valign="top" class="value ${hasErrors(bean:messageInstance,field:'message','errors')}">
                    <input type="text" id="message" name="message" value="${fieldValue(bean:messageInstance,field:'message')}"/>
                  </td>
                  </tr> 
                </tbody>
              </table>
            </div>
          <div class="buttons">
            <span class="button"><input class="save" type="submit" value="Update" /></span>
          </div>
        </g:form>
      </div>

            <div class="list">
                <table>
                    <thead>
                        <tr>
                        
                        
                   	        <g:sortableColumn property="message" title="Message" />
                        
                        </tr>
                    </thead>
                    <tbody>
                    <g:each in="${messageInstanceList}" status="i" var="messageInstance">
                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                        
                        
                            <td>${fieldValue(bean:messageInstance, field:'message')}</td>
                        
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>
            <div class="paginateButtons">
                <g:paginate total="${Message.count()}" />
            </div>
        </div>
        <img src="http://chart.apis.google.com/chart?cht=bvs&chs=200x125&chd=s:${chartData}&chco=1d89f9&chds=50,63"/>
    </body>
</html>
